import cv2
import numpy as np

def chose(image):
    cv_image = np.array(image)
    cv_image = cv2.cvtColor(cv_image, cv2.COLOR_RGB2BGR)
    cv2.namedWindow("window", cv2.WINDOW_NORMAL) # 创建一个可调整大小的窗口
    cv2.resizeWindow("window", 1280, 720) # 将窗口设置为800x600
    r = cv2.selectROI("window",cv_image)
    # print(r) # 打印出选定区域的坐标，格式为(x, y, w, h)
    cv2.destroyAllWindows() # 关闭所有窗口)
    crop_area=(r[0],r[1],r[0]+r[2],r[1]+r[3])
    return crop_area
